package model.spring;

public class PostalAddress extends AbstractAddress {
	
	private static final long serialVersionUID = 3077020354309617366L;
	
	private String street, city, housenumber, zipcode;
	
	public PostalAddress() {
		init();
	}
	
	private void init() {
		this.name = "";
		this.emailaddress = "";
		this.street = "";
		this.housenumber = "";
		this.zipcode = "";
		this.city = "";
	}
	
	public void setStreet(String street) {
		this.street = street;
	}

	public String getStreet() {
		return street;
	}
	
	public void setCity(String city) {
		this.city = city;
	}

	public String getCity() {
		return city;
	}
	public void setHousenumber(String housenumber) {
		this.housenumber = housenumber;
	}

	public String getHousenumber() {
		return housenumber;
	}
	
	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}

	public String getZipcode() {
		return zipcode;
	}
	
	public String toString() {
		return super.toString()+" | " + street + " " + housenumber + " | " + zipcode + " " + city ;
	}
	
	public AbstractAddress clone() {
		PostalAddress clone = new PostalAddress();
		clone.setName(this.getName());
		clone.setEmailaddress(this.getEmailaddress());
		clone.setCity(this.getCity());
		clone.setHousenumber(this.getHousenumber());
		clone.setStreet(this.getStreet());
		clone.setZipcode(this.getZipcode());
		return clone;
	}
	
}
